import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:online_study/base/app_title.dart';
import 'package:online_study/home/special/special_details.dart';
import 'package:online_study/theme/colors.dart';
import 'package:online_study/theme/size.dart';

//专题列表
class SpecialListPage extends StatefulWidget {
  @override
  _SpecialListPageState createState() => _SpecialListPageState();
}

class _SpecialListPageState extends State<SpecialListPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: BackButton(color: ThemeColor.color333333),
        titleSpacing: 0,
        elevation: ThemeSize.appElevation,
        backgroundColor: ThemeColor.colorWhite,
        title: AppTitle("专题列表"),
      ),
      body: ListView.builder(
          itemBuilder: (BuildContext context, int index) {
            return GestureDetector(
              child: Container(
                width: double.infinity,
                height: ThemeSize.height126,
                margin: EdgeInsets.only(
                    left: ThemeSize.width9,
                    right: ThemeSize.width9,
                    top: ThemeSize.height12),
                decoration: BoxDecoration(
                    borderRadius: BorderRadius.circular(ThemeSize.width8),
                    image: DecorationImage(
                        image: NetworkImage(
                            "https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg"),
                        fit: BoxFit.cover)),
              ),
              onTap: () {
                Get.to(() => SpecialDetailsPage());
              },
            );
          },
          itemCount: 3,
          shrinkWrap: true),
    );
  }
}
